package com.yzkj.siot.result;

import lombok.Data;

@Data
public class ResponseResult<T> {

    /**
     * 状态码，成功时应返回0
     */
    private Integer code;

    /**
     * 是否成功
     */
    private Boolean success;

    /**
     * 状态信息
     */
    private String msg;

    /**
     * 数据
     */
    private T data;

    public ResponseResult(T data) {
        this.code = 0;
        this.success = Boolean.TRUE;
        this.data = data;
        this.msg = "success";
    }

    public ResponseResult(Integer code, Boolean success, String msg, T data) {
        this.code = code;
        this.success = success;
        this.data = data;
        this.msg = msg;
    }
}